#include "irm_search.h"

namespace ophies
{


Search::Search()
: m_attrs(new QHash<QString, QString>())
{
}

Search::~Search()
{
	delete m_attrs;
}

void Search::insert(QString key, QString value)
{
	m_attrs->insert(key, value);
}

void Search::remove(QString key)
{
	m_attrs->remove(key);
}

void Search::setQueryTo(QUrl &url)
{
	QList<QString> keys = m_attrs->keys();
	for( int i = 0; i < keys.size(); i++ )
	{
		url.addQueryItem(keys[i], m_attrs->value(keys[i]));
	}
}

QString Search::toQueryString()
{
	QStringList list;

	QList<QString> keys = m_attrs->keys();
	for( int i = 0; i < keys.size(); i++ )
	{
		list.append(QString(keys[i] + "=" + m_attrs->value(keys[i])));
	}

	return list.join("&");
}

int Search::getItemCount()
{
	return m_attrs->size();
}

//QList<QString>* Search::getItems()
//{
//	return m_attrs->keys();
//}

SearchDcmStudies::SearchDcmStudies()
{

}

SearchDcmStudies::~SearchDcmStudies()
{

}

SearchDcmSeries::SearchDcmSeries()
{

}

SearchDcmSeries::~SearchDcmSeries()
{

}

SearchDcmInstances::SearchDcmInstances()
{

}

SearchDcmInstances::~SearchDcmInstances()
{

}

SearchDocsets::SearchDocsets()
{

}
SearchDocsets::~SearchDocsets()
{

}

SearchPatients::SearchPatients()
{

}

SearchPatients::~SearchPatients()
{

}







// auto generated code
// @author ejoonie
// @date 20140505_161010
void SearchDcmStudies::set_dcm_study_key( QString value ){ insert("dcm_study_key", value); }
void SearchDcmStudies::remove_dcm_study_key(){ remove( "dcm_study_key" ); }

void SearchDcmStudies::set_vgroup_key( QString value ){ insert("vgroup_key", value); }
void SearchDcmStudies::remove_vgroup_key(){ remove( "vgroup_key" ); }

void SearchDcmStudies::set_study_instance_uid( QString value ){ insert("study_instance_uid", value); }
void SearchDcmStudies::remove_study_instance_uid(){ remove( "study_instance_uid" ); }

void SearchDcmStudies::set_patient_key( QString value ){ insert("patient_key", value); }
void SearchDcmStudies::remove_patient_key(){ remove( "patient_key" ); }

void SearchDcmStudies::set_patient_id( QString value ){ insert("patient_id", value); }
void SearchDcmStudies::remove_patient_id(){ remove( "patient_id" ); }

void SearchDcmStudies::set_patient_name( QString value ){ insert("patient_name", value); }
void SearchDcmStudies::remove_patient_name(){ remove( "patient_name" ); }

void SearchDcmStudies::set_patient_sex( QString value ){ insert("patient_sex", value); }
void SearchDcmStudies::remove_patient_sex(){ remove( "patient_sex" ); }

void SearchDcmStudies::set_patient_birth_dttm( QString value ){ insert("patient_birth_dttm", value); }
void SearchDcmStudies::remove_patient_birth_dttm(){ remove( "patient_birth_dttm" ); }

void SearchDcmStudies::set_patient_age( QString value ){ insert("patient_age", value); }
void SearchDcmStudies::remove_patient_age(){ remove( "patient_age" ); }

void SearchDcmStudies::set_patient_weight( QString value ){ insert("patient_weight", value); }
void SearchDcmStudies::remove_patient_weight(){ remove( "patient_weight" ); }

void SearchDcmStudies::set_patient_size( QString value ){ insert("patient_size", value); }
void SearchDcmStudies::remove_patient_size(){ remove( "patient_size" ); }

void SearchDcmStudies::set_study_id( QString value ){ insert("study_id", value); }
void SearchDcmStudies::remove_study_id(){ remove( "study_id" ); }

void SearchDcmStudies::set_study_dttm( QString value ){ insert("study_dttm", value); }
void SearchDcmStudies::remove_study_dttm(){ remove( "study_dttm" ); }

void SearchDcmStudies::set_accession_no( QString value ){ insert("accession_no", value); }
void SearchDcmStudies::remove_accession_no(){ remove( "accession_no" ); }

void SearchDcmStudies::set_study_desc( QString value ){ insert("study_desc", value); }
void SearchDcmStudies::remove_study_desc(){ remove( "study_desc" ); }

void SearchDcmStudies::set_study_size( QString value ){ insert("study_size", value); }
void SearchDcmStudies::remove_study_size(){ remove( "study_size" ); }

void SearchDcmStudies::set_series_count( QString value ){ insert("series_count", value); }
void SearchDcmStudies::remove_series_count(){ remove( "series_count" ); }

void SearchDcmStudies::set_instance_count( QString value ){ insert("instance_count", value); }
void SearchDcmStudies::remove_instance_count(){ remove( "instance_count" ); }

void SearchDcmStudies::set_created_dttm( QString value ){ insert("created_dttm", value); }
void SearchDcmStudies::remove_created_dttm(){ remove( "created_dttm" ); }

void SearchDcmStudies::set_updated_dttm( QString value ){ insert("updated_dttm", value); }
void SearchDcmStudies::remove_updated_dttm(){ remove( "updated_dttm" ); }

void SearchDcmStudies::set_deleted_dttm( QString value ){ insert("deleted_dttm", value); }
void SearchDcmStudies::remove_deleted_dttm(){ remove( "deleted_dttm" ); }

void SearchDcmStudies::set_url( QString value ){ insert("url", value); }
void SearchDcmStudies::remove_url(){ remove( "url" ); }

void SearchDcmSeries::set_dcm_series_key( QString value ){ insert("dcm_series_key", value); }
void SearchDcmSeries::remove_dcm_series_key(){ remove( "dcm_series_key" ); }

void SearchDcmSeries::set_vgroup_key( QString value ){ insert("vgroup_key", value); }
void SearchDcmSeries::remove_vgroup_key(){ remove( "vgroup_key" ); }

void SearchDcmSeries::set_series_instance_uid( QString value ){ insert("series_instance_uid", value); }
void SearchDcmSeries::remove_series_instance_uid(){ remove( "series_instance_uid" ); }

void SearchDcmSeries::set_dcm_study_key( QString value ){ insert("dcm_study_key", value); }
void SearchDcmSeries::remove_dcm_study_key(){ remove( "dcm_study_key" ); }

void SearchDcmSeries::set_modality( QString value ){ insert("modality", value); }
void SearchDcmSeries::remove_modality(){ remove( "modality" ); }

void SearchDcmSeries::set_series_no( QString value ){ insert("series_no", value); }
void SearchDcmSeries::remove_series_no(){ remove( "series_no" ); }

void SearchDcmSeries::set_series_dttm( QString value ){ insert("series_dttm", value); }
void SearchDcmSeries::remove_series_dttm(){ remove( "series_dttm" ); }

void SearchDcmSeries::set_series_desc( QString value ){ insert("series_desc", value); }
void SearchDcmSeries::remove_series_desc(){ remove( "series_desc" ); }

void SearchDcmSeries::set_bodypart( QString value ){ insert("bodypart", value); }
void SearchDcmSeries::remove_bodypart(){ remove( "bodypart" ); }

void SearchDcmSeries::set_series_size( QString value ){ insert("series_size", value); }
void SearchDcmSeries::remove_series_size(){ remove( "series_size" ); }

void SearchDcmSeries::set_instance_count( QString value ){ insert("instance_count", value); }
void SearchDcmSeries::remove_instance_count(){ remove( "instance_count" ); }

void SearchDcmSeries::set_created_dttm( QString value ){ insert("created_dttm", value); }
void SearchDcmSeries::remove_created_dttm(){ remove( "created_dttm" ); }

void SearchDcmSeries::set_deleted_dttm( QString value ){ insert("deleted_dttm", value); }
void SearchDcmSeries::remove_deleted_dttm(){ remove( "deleted_dttm" ); }

void SearchDcmSeries::set_url( QString value ){ insert("url", value); }
void SearchDcmSeries::remove_url(){ remove( "url" ); }

void SearchDcmInstances::set_dcm_instance_key( QString value ){ insert("dcm_instance_key", value); }
void SearchDcmInstances::remove_dcm_instance_key(){ remove( "dcm_instance_key" ); }

void SearchDcmInstances::set_vgroup_key( QString value ){ insert("vgroup_key", value); }
void SearchDcmInstances::remove_vgroup_key(){ remove( "vgroup_key" ); }

void SearchDcmInstances::set_sop_instance_uid( QString value ){ insert("sop_instance_uid", value); }
void SearchDcmInstances::remove_sop_instance_uid(){ remove( "sop_instance_uid" ); }

void SearchDcmInstances::set_sop_class_uid( QString value ){ insert("sop_class_uid", value); }
void SearchDcmInstances::remove_sop_class_uid(){ remove( "sop_class_uid" ); }

void SearchDcmInstances::set_dcm_series_key( QString value ){ insert("dcm_series_key", value); }
void SearchDcmInstances::remove_dcm_series_key(){ remove( "dcm_series_key" ); }

void SearchDcmInstances::set_dcm_study_key( QString value ){ insert("dcm_study_key", value); }
void SearchDcmInstances::remove_dcm_study_key(){ remove( "dcm_study_key" ); }

void SearchDcmInstances::set_instance_no( QString value ){ insert("instance_no", value); }
void SearchDcmInstances::remove_instance_no(){ remove( "instance_no" ); }

void SearchDcmInstances::set_content_dttm( QString value ){ insert("content_dttm", value); }
void SearchDcmInstances::remove_content_dttm(){ remove( "content_dttm" ); }

void SearchDcmInstances::set_instance_size( QString value ){ insert("instance_size", value); }
void SearchDcmInstances::remove_instance_size(){ remove( "instance_size" ); }

void SearchDcmInstances::set_created_dttm( QString value ){ insert("created_dttm", value); }
void SearchDcmInstances::remove_created_dttm(){ remove( "created_dttm" ); }

void SearchDcmInstances::set_deleted_dttm( QString value ){ insert("deleted_dttm", value); }
void SearchDcmInstances::remove_deleted_dttm(){ remove( "deleted_dttm" ); }

void SearchDcmInstances::set_url( QString value ){ insert("url", value); }
void SearchDcmInstances::remove_url(){ remove( "url" ); }

void SearchDocsets::set_docset_key( QString value ){ insert("docset_key", value); }
void SearchDocsets::remove_docset_key(){ remove( "docset_key" ); }

void SearchDocsets::set_vgroup_key( QString value ){ insert("vgroup_key", value); }
void SearchDocsets::remove_vgroup_key(){ remove( "vgroup_key" ); }

void SearchDocsets::set_vgroup_id( QString value ){ insert("vgroup_id", value); }
void SearchDocsets::remove_vgroup_id(){ remove( "vgroup_id" ); }

void SearchDocsets::set_vgroup_id_type( QString value ){ insert("vgroup_id_type", value); }
void SearchDocsets::remove_vgroup_id_type(){ remove( "vgroup_id_type" ); }

void SearchDocsets::set_vgroup_name( QString value ){ insert("vgroup_name", value); }
void SearchDocsets::remove_vgroup_name(){ remove( "vgroup_name" ); }

void SearchDocsets::set_docset_uid( QString value ){ insert("docset_uid", value); }
void SearchDocsets::remove_docset_uid(){ remove( "docset_uid" ); }

void SearchDocsets::set_docset_class_uid( QString value ){ insert("docset_class_uid", value); }
void SearchDocsets::remove_docset_class_uid(){ remove( "docset_class_uid" ); }

void SearchDocsets::set_docset_group_uid( QString value ){ insert("docset_group_uid", value); }
void SearchDocsets::remove_docset_group_uid(){ remove( "docset_group_uid" ); }

void SearchDocsets::set_filter_key( QString value ){ insert("filter_key", value); }
void SearchDocsets::remove_filter_key(){ remove( "filter_key" ); }

void SearchDocsets::set_filter_uid( QString value ){ insert("filter_uid", value); }
void SearchDocsets::remove_filter_uid(){ remove( "filter_uid" ); }

void SearchDocsets::set_filter_class_uid( QString value ){ insert("filter_class_uid", value); }
void SearchDocsets::remove_filter_class_uid(){ remove( "filter_class_uid" ); }

void SearchDocsets::set_filter_name( QString value ){ insert("filter_name", value); }
void SearchDocsets::remove_filter_name(){ remove( "filter_name" ); }

void SearchDocsets::set_patient_key( QString value ){ insert("patient_key", value); }
void SearchDocsets::remove_patient_key(){ remove( "patient_key" ); }

void SearchDocsets::set_patient_id_value( QString value ){ insert("patient_id_value", value); }
void SearchDocsets::remove_patient_id_value(){ remove( "patient_id_value" ); }

void SearchDocsets::set_patient_name( QString value ){ insert("patient_name", value); }
void SearchDocsets::remove_patient_name(){ remove( "patient_name" ); }

void SearchDocsets::set_docset_created_dttm( QString value ){ insert("docset_created_dttm", value); }
void SearchDocsets::remove_docset_created_dttm(){ remove( "docset_created_dttm" ); }

void SearchDocsets::set_docset_deleted_dttm( QString value ){ insert("docset_deleted_dttm", value); }
void SearchDocsets::remove_docset_deleted_dttm(){ remove( "docset_deleted_dttm" ); }

void SearchDocsets::set_xds_docset_key( QString value ){ insert("xds_docset_key", value); }
void SearchDocsets::remove_xds_docset_key(){ remove( "xds_docset_key" ); }

void SearchDocsets::set_metadata_xml( QString value ){ insert("metadata_xml", value); }
void SearchDocsets::remove_metadata_xml(){ remove( "metadata_xml" ); }

void SearchDocsets::set_docset_uuid( QString value ){ insert("docset_uuid", value); }
void SearchDocsets::remove_docset_uuid(){ remove( "docset_uuid" ); }

void SearchDocsets::set_source_id( QString value ){ insert("source_id", value); }
void SearchDocsets::remove_source_id(){ remove( "source_id" ); }

void SearchDocsets::set_content_type_code_value( QString value ){ insert("content_type_code_value", value); }
void SearchDocsets::remove_content_type_code_value(){ remove( "content_type_code_value" ); }

void SearchDocsets::set_content_type_coding_scheme( QString value ){ insert("content_type_coding_scheme", value); }
void SearchDocsets::remove_content_type_coding_scheme(){ remove( "content_type_coding_scheme" ); }

void SearchDocsets::set_content_type_code_meaning( QString value ){ insert("content_type_code_meaning", value); }
void SearchDocsets::remove_content_type_code_meaning(){ remove( "content_type_code_meaning" ); }

void SearchDocsets::set_docset_status( QString value ){ insert("docset_status", value); }
void SearchDocsets::remove_docset_status(){ remove( "docset_status" ); }

void SearchDocsets::set_docset_title( QString value ){ insert("docset_title", value); }
void SearchDocsets::remove_docset_title(){ remove( "docset_title" ); }

void SearchDocsets::set_docset_comments( QString value ){ insert("docset_comments", value); }
void SearchDocsets::remove_docset_comments(){ remove( "docset_comments" ); }

void SearchDocsets::set_submit_dttm( QString value ){ insert("submit_dttm", value); }
void SearchDocsets::remove_submit_dttm(){ remove( "submit_dttm" ); }

void SearchDocsets::set_xds_docset_created_dttm( QString value ){ insert("xds_docset_created_dttm", value); }
void SearchDocsets::remove_xds_docset_created_dttm(){ remove( "xds_docset_created_dttm" ); }

void SearchDocsets::set_xds_docset_deleted_dttm( QString value ){ insert("xds_docset_deleted_dttm", value); }
void SearchDocsets::remove_xds_docset_deleted_dttm(){ remove( "xds_docset_deleted_dttm" ); }

void SearchDocsets::set_document_count( QString value ){ insert("document_count", value); }
void SearchDocsets::remove_document_count(){ remove( "document_count" ); }

void SearchDocsets::set_url( QString value ){ insert("url", value); }
void SearchDocsets::remove_url(){ remove( "url" ); }

void SearchPatients::set_patient_key( QString value ){ insert("patient_key", value); }
void SearchPatients::remove_patient_key(){ remove( "patient_key" ); }

void SearchPatients::set_patient_id_value( QString value ){ insert("patient_id_value", value); }
void SearchPatients::remove_patient_id_value(){ remove( "patient_id_value" ); }

void SearchPatients::set_patient_name( QString value ){ insert("patient_name", value); }
void SearchPatients::remove_patient_name(){ remove( "patient_name" ); }

void SearchPatients::set_patient_sex( QString value ){ insert("patient_sex", value); }
void SearchPatients::remove_patient_sex(){ remove( "patient_sex" ); }

void SearchPatients::set_patient_birth_dttm( QString value ){ insert("patient_birth_dttm", value); }
void SearchPatients::remove_patient_birth_dttm(){ remove( "patient_birth_dttm" ); }

void SearchPatients::set_related_patient_key( QString value ){ insert("related_patient_key", value); }
void SearchPatients::remove_related_patient_key(){ remove( "related_patient_key" ); }

void SearchPatients::set_created_dttm( QString value ){ insert("created_dttm", value); }
void SearchPatients::remove_created_dttm(){ remove( "created_dttm" ); }

void SearchPatients::set_deleted_dttm( QString value ){ insert("deleted_dttm", value); }
void SearchPatients::remove_deleted_dttm(){ remove( "deleted_dttm" ); }

void SearchPatients::set_url( QString value ){ insert("url", value); }
void SearchPatients::remove_url(){ remove( "url" ); }





} // namespace ophiesss